﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Globalization;

namespace Theoreme.Library
{
    public static class ExtensionOfString
    {
        /// <summary>
        /// Capitalizes each word in the specified target.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <returns></returns>
        public static string ToTitleCase(this string target)
        {
            // Creates a TextInfo based on the "en-US" culture.
            var textInfo = new CultureInfo("en-US", false).TextInfo;             
            return textInfo.ToTitleCase(target);
        }
    }
}
